home *** CD-ROM | disk | FTP | other *** search
- # Copyright © 1996 by Apple Computer, Inc. All rights reserved.
- # SCMBuild
- #
- #FILE
- # SCMBuild
- #
- #NAME
- # Int64Lib
- #
- #DESCRIPTION
- # This MPW Build file contains MPW Shell instructions to build
- # the Shared Int64Lib library
- #
- #MODIFICATION HISTORY
- # Created by Terry Teague
- #
- # 18 Jul 96 - TRT - Initial version
- # 28 Jul 96 - TRT - Modified to use new naming conventions
- # 05 Aug 96 - TRT - Define {Shared.Includes} if necessary
- #
-
- Set StartTime `Date -n`
- Echo "# Started Int64Lib build at : `Date -t`"
-
- #=============================================================================================
- # Available options for this script (usage string)
- #=============================================================================================
-
- Set UsageString "∂
- SCMBuild # Build Int64Lib products∂n∂
- SCMBuild [option…]∂n∂
- -H[elp] # Show this help messge∂n∂
- -TestWide # make the TestWide application∂n∂
- -WideLib # make the WideLib library (default)∂n∂
- -68K # make a 68K only version∂n∂
- -PPC # make a PPC only version∂n∂
- -FAT # make both 68K and PPC versions (default)∂n∂
- -R[ebuild] # do a clean build∂n∂
- -MPW # use MPW as the development system (default)∂n∂
- -MW # use MetroWerks as the development system∂n∂
- -SC # use Symantec as the development system∂n∂
- -noUni # don't use Universal Headers (implies 68K only)∂n∂
- -UniV1 # use Universal Headers v1.0 (default)∂n∂
- -UniV2 # use Universal Headers v2.x∂n∂
- -UniV3 # use Universal Headers v3.x∂n∂
- "
-
- #=============================================================================================
- # Names of products
- #=============================================================================================
-
- Set LibName WideLib
- Set TestName TestWide
- Set BuildName {LibName}
-
- #=============================================================================================
- # Assume no script input parameters - set Shell variables to default options
- #=============================================================================================
-
- Set newParams ""
- Set ShowHelpOnly 0
- Set doRebuild 0
-
- Set OtherMakeOptions ""
- If "{MPWVersion}" !~ /3.4≈/
- Set BuildOptions "-d Wide68K=Wide.68K.lib -d WidePPC=Wide.PPC.xcoff ∂
- -d TestWide68K=TestWide.68K -d TestWidePPC=TestWide.PPC ∂
- -d TestWideFAT=TestWide.FAT"
- Else
- Set BuildOptions "-d Wide68K=Wide.68K.lib.SC -d WidePPC=Wide.PPC.xcoff.MrC ∂
- -d TestWide68K=TestWide.68K.SC -d TestWidePPC=TestWide.PPC.MrC ∂
- -d TestWideFAT=TestWide.FAT.SCMrC"
- End
- Set PreUniHeaders "-d qPreUniHeaders=1" #set to 0 for Universal Headers
-
- #=============================================================================================
- # Echo the command
- #=============================================================================================
-
- Open "{WorkSheet}"
- Echo "∂n{0} {Parameters}"
-
- #=============================================================================================
- # Build 68K and PPC versions of WideLib by default if no parameters given
- #=============================================================================================
-
- If {#} == 0
- End
-
- #=============================================================================================
- # Process the script parameters
- #=============================================================================================
-
- For x in {"parameters"}
- If "{x}" =~ /-H(elp)«0,1»/
- Set ShowHelpOnly 1
- Else If "{x}" =~ /-TestWide/
- Set BuildName "{TestName}"
- Else If "{x}" =~ /-WideLib/
- Set BuildName "{LibName}"
- Else If "{x}" =~ /-68K/
- If "{MPWVersion}" !~ /3.4≈/
- Set BuildOptions "-d Wide68K=Wide.68K.lib -d WidePPC= ∂
- -d TestWide68K=TestWide.68K -d TestWidePPC= ∂
- -d TestWideFAT="
- Else
- Set BuildOptions "-d Wide68K=Wide.68K.lib.SC -d WidePPC= ∂
- -d TestWide68K=TestWide.68K.SC -d TestWidePPC= ∂
- -d TestWideFAT="
- End
- Else If "{x}" =~ /-PPC/
- If "{MPWVersion}" !~ /3.4≈/
- Set BuildOptions "-d Wide68K= -d WidePPC=Wide.PPC.xcoff ∂
- -d TestWide68K= -d TestWidePPC=TestWide.PPC ∂
- -d TestWideFAT="
- Else
- Set BuildOptions "-d Wide68K= -d WidePPC=Wide.PPC.xcoff.MrC ∂
- -d TestWide68K= -d TestWidePPC=TestWide.PPC.MrC ∂
- -d TestWideFAT="
- End
- Else If "{x}" =~ /-FAT/
- If "{MPWVersion}" !~ /3.4≈/
- Set BuildOptions "-d Wide68K=Wide.68K.lib -d WidePPC=Wide.PPC.xcoff ∂
- -d TestWide68K=TestWide.68K -d TestWidePPC=TestWide.PPC ∂
- -d TestWideFAT=TestWide.FAT"
- Else
- Set BuildOptions "-d Wide68K=Wide.68K.lib.SC -d WidePPC=Wide.PPC.xcoff.MrC ∂
- -d TestWide68K=TestWide.68K.SC -d TestWidePPC=TestWide.PPC.MrC ∂
- -d TestWideFAT=TestWide.FAT.SCMrC"
- End
- Else If "{x}" =~ /-R(ebuild)«0,1»/
- Set doRebuild 1
- Else If "{x}" =~ /-NoUni/
- Set PreUniHeaders "-d qPreUniHeaders=1" #set to 1 for pre-Universal Headers
- Set PPCCIncludes "{CIncludes}"
- Else If "{x}" =~ /-UniV1/
- Set PreUniHeaders "-d qPreUniHeaders=0 -d qUniHeadersV1=1" #set to 0 for Universal Headers
- Else If "{x}" =~ /-UniV2/
- Set PreUniHeaders "-d qPreUniHeaders=0 -d qUniHeadersV2=1" #set to 0 for Universal Headers
- Else If "{x}" =~ /-UniV3/
- Set PreUniHeaders "-d qPreUniHeaders=0 -d qUniHeadersV3=1" #set to 0 for Universal Headers
- Else
- Set newParams "{newParams} {x}"
- End
- End
-
- #=============================================================================================
- # Handle error conditions in script parameters, and handle help
- #=============================================================================================
-
- If {ShowHelpOnly}
- Echo "{UsageString}" > Dev:StdOut
- Exit 0
- End
-
- #=============================================================================================
- # Build it
- #=============================================================================================
-
- #Set COptions "-r -mbg off -warnings off -d qTiming=0"
- #Export COptions
-
- If "{Shared.Includes}" == ""
- If "`Exists -d :Includes:`"
- Set Shared.Includes ":Includes:"
- Else
- Set Shared.Includes ":"
- End
- Export Shared.Includes
- End
-
- If "{MPWVersion}" !~ /3.4≈/
- # For MPW 3.3.x, must use pre-Universal CIncludes -
- # you may have to tweak this for your own use
- # (Universal Headers 2.0 has a conflict between Types.h and SANE.h)
- If "`Exists -d {MPW}Interfaces:68KCIncludes:`"
- Set CIncludes "{MPW}Interfaces:68KCIncludes:"
- End
- End
-
- # Options to pass to the C compiler
- #Set OtherCOptions "-d OtherCOptions='{BuildOptions}'"
-
- # Options to pass to Make
- # To turn on Macsbug symbol, use -d MacsBug=full. SADE symbols, -d Symbols=full.
- # Or you can pass the option from the command line, eg., -d Macsbug=full
- Set OtherMakeOptions "-d PreUniHeaders=∂'{PreUniHeaders}∂' {BuildOptions}"
-
- If Not "`Exists -d :Objects:`"
- NewFolder ":Objects:"
- End
-
- #
- # Do a clean build
- #
- If {doRebuild}
- End
-
- Echo -n "#--->"
- Echo "::building {BuildName}"
-
- BuildProgram "{BuildName}" {OtherCOptions} {OtherMakeOptions} {newParams}
-
- #=============================================================================================
- # Clean up and exit
- #=============================================================================================
-
- #Directory "{SavedDirectory}"
-
- Set EndTime `Date -n`
- Set BuildTime `Evaluate {EndTime} - {StartTime}`
- Set minutes `Evaluate {BuildTime} ÷ 60`
- Set seconds `Evaluate {BuildTime} - ({minutes} * 60)`
-
- Echo "# Build Time: {minutes} minutes {seconds} seconds"
-